<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>用户中心-到货通知</title>
    [#include "common/include.ftl"]
    <link rel="styleSheet" href="${base}/resource/css/member.css">
    [#import "common/pagination.ftl" as p/]

    <script type="text/javascript">
        //删除
        function del(context, id){
            var dialog =  oDialog.confirm("你确定删除?",
                    function(){
                        ajax({
                            url: base + '/member/stocknotice/delete.jhtml',
                            data: {id:id},
                            success: function(data){

                                oDialog.prompt(data.content, 2000);
                                if(data.type == 'success'){
                                    if($('tr',context.closest('table')).length < 4){
                                        location.reload();
                                    }
                                    context.closest('tr').remove();
                                }
                            }
                        });
                    },
                    function(){
                        dialog.close();
                    },
                    "删除到货通知",true
            );
        }
        //再次通知
        function agenNotice(context, id){
            ajax({
                url: base + '/member/stocknotice/register.jhtml',
                data: {goodsId:id},
                success: function(data){
                    if(data.type == 'success'){
                        context.remove();
                    }
                    oDialog.prompt(data.content, 2000, true);
                }
            });
        }
    </script>
</head>
<body class="customer">
<div class="top">
    [#include "common/header.ftl"]
</div>
<div class="crumbs">
    <a href="${base}/member/index.jhtml">会员中心</a>
	<i style='font-family: simsun;font-style: normal;'>></i>
	<a href="#">消息中心</a>
	<i style='font-family: simsun;font-style: normal;'>></i>
	<a href="#">到货通知</a>
</div>
<div id="member-main">
	[#assign menuNo = 'stocknotice'/]
    [#include "common/member-left.ftl"/]

    <div class="member-right">
        <div class="right-wrap">
            <h2 class="right-title">到货通知</h2>

            <div class="r-prompt">温馨提示：商品到货后，我们将以邮件的方式通知您！</div>
            <div class="member-order">
                <div class="clear"></div>
                <table class="member-table-list" id="order-list">
                    <tr>
                        <th width="30%">商品名称</th>
                        <th width="10%">库存</th>
                        <th width="25%">生产厂商</th>
                        <th width="15%">规格</th>
                        <th>操作</th>
                    </tr>

                [#if pager?? && pager.list?has_content]
                    [#list pager.list as notice]
                        <tr>
                            <td><a href="${base}/goods/${notice.goodsId}.jhtml">${notice.goodsName}</a></td>
                            <td>
                                [#if notice.stock <= 0]
                                    无货
                                [#elseif notice.stock < 100]
                                    ${notice.stock}
                                [#else]
                                    有货
                                [/#if]
                            </td>
                            <td>${notice.manufacturer}</td>
                            <td>${notice.spec}</td>
                            <td>
                                <a onclick="del($(this),${notice.id})">删除</a>
                                [#if notice.isNotice && notice.stock = 0]
                                    <a onclick="agenNotice($(this), ${notice.goodsId})">再次通知我</a>
                                [/#if]
                            </td>
                        </tr>
                    [/#list]
                [#else]
                    <tr>
                        <td colspan="5" class="list-empty">暂无记录</td>
                    </tr>
                [/#if]

                    <tr>
                        <td colspan="5">
                        [@p.pager pager = pager url = "${base}/member/stocknotice/list.jhtml"/]
                        </td>
                    </tr>

                </table>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
[#include "common/footer-slidebar-lazyload.ftl"]
</body>
</html>